interface MyInterface {
  readonly name: string;
  age?: number;
  sex: boolean;
  // [proName: string]: any;
  say: (str: string) => void
}

let obj1: MyInterface = {
  name: '1244',
  age: 20,
  sex: true,
  // proName:
  say(str) {
    return true
  }
};


// obj.name = '124';

class Person5 {
  // 构造 abc 修饰符 private readonly  类型 string
  // private : 私有的  public: 公共的  让不让外部访问
  // readonly : 只读 不能修改的
  // ? : 放在变量的后面 可选变量

  private sex: boolean;


  constructor(private readonly abc: string, public readonly name: string) {
    this.sex = true;
  }

}

// 实例
let person5 = new Person5('123', '小张');

// person.name = '3434'

// console.log(person.name);




